<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@ include file="/web/head.jsp"%>
</head>
<body>
	<div style="width: 85%; margin-top: 30px;" align="center">
		<form class="layui-form">
			<div class="layui-form-item">
				<label class="layui-form-label">审查员</label>
				<div class="layui-input-block">
					<select name="editor" lay-verify="required" lay-search>
					</select>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">是否通过</label>
				<div class="layui-input-block">
					<input type="radio" name="result" value="pass" title="通过">
					<input type="radio" name="result" value="notpass" title="未通过"
						checked>
				</div>
			</div>
			<div class="layui-form-item layui-form-text">
				<label class="layui-form-label">留言</label>
				<div class="layui-input-block">
					<textarea name="message" placeholder="请输入内容" class="layui-textarea"></textarea>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">日期</label>
				<div class="layui-input-block">
					<input type="text" name="date" class="layui-input" id="test1">
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-input-block">
					<input class="layui-btn" lay-submit lay-filter="formDemo" value="提交">
					<input type="reset" class="layui-btn layui-btn-primary" value="重置">
				</div>
			</div>
			<input type="hidden" name="action" value="add">
		</form>
	</div>

	<script type="text/javascript">
			var id = '<%=request.getParameter("id")%>'

		ajax('/EditorServlet', 'json', {
			action : 'getAll'
		}, function(res) {
			var html = "<option value=''>请输入</option>"
			$.each(res, function(i, dom) {
				html += '<option value="'+dom.account+'">' + dom.nickName
						+ '</option>'
			})
			$('select').html(html)
			form.render('select')
		})

		laydate.render({
			elem : '#test1' //指定元素
		});
		
		formOnSubmit('formDemo', 'text', '/ReviewRecordsServlet?id='+id, function(data){
			if (data == 'success') {
				layer.msg("添加成功", {
					time : 1000,
					icon : 6
				}, frameClose)
			} else {
				layer.msg("添加失败", {
					time : 1000,
					icon : 5
				})
			}
		})
		
	</script>
</body>
</html>